<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title></title>

    <!-- Bootstrap -->
     <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
 <!--    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-theme.min.css"> -->

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>

    <!-- 加载 Bootstrap 的所有 JavaScript 插件 -->
<!--     <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script> -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
	<link rel="stylesheet" type="text/css" href="css/yi.css"/>
    <style type="text/css">
	.aj{
		width: 300px;
		text-align: center;
		margin: 0 auto;
	}
	input{
		margin-left: 30px;
	}

	.wz{
		float: left;
	}
	.j{
		text-align: center;
	}
	#juz{
		width: 500px;
		margin: 0 auto;
		position: relative;
		top: 50%;
	}
	img{
		width: 200px;
		height: 230px;
	}
	

    </style>
</head>

<body>
	<script type="text/javascript">
		$('#myModal').on('shown.bs.modal', function () {
		  $('#myInput').focus()
		})
	</script>
	<?php
	header("content-type:text/html;charset=utf-8");
	$serverName="localhost";
	$userName="root";
	$password="root";
	$dbName="yx";
	
	$conn =new mysqli($serverName,$userName,$password,$dbName);
	mysqli_set_charset($conn,'utf8');
	
	echo"<br>";
	if(mysqli_connect_error()){
		die("链接失败：".mysqli_connect_error());
	}else{
		echo "成功";
	}
	echo "<br>";
	
	$sql="select * from yxb";
	$result=mysqli_query($conn,$sql);
	$s=$_GET['name'];
	
	$sql="SELECT * FROM yxb where yxmc='$s'";
			
			$result=mysqli_query($conn,$sql);
			
			if(mysqli_num_rows($result)>0){
				while($row=mysqli_fetch_object($result)){
   
				 $q=$row->yxmc;						  
				 $w=$row->yxjg;
				$e=$row->yxpf;
				$r=$row->yxdx;
				$t=$row->yxpt;
				$y=$row->yxms;
				$u=$row->fxsj;
				$i=$row->sj;
				$o=$row->yy;
				$p=$row->tp;
				
				
								 
						       
						        }
								
						}
	
	?>
	
	
	<div class="container">	
	<nav id="navbar-example" class="navbar navbar-default navbar-fixed-top yangse" role="navigation">
	    <div class="container-fluid yangse">
	
	        <div class="navbar-header" >
	            <a href="#" class="navbar-brand">carshop</a>
	            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#js-navbar-scrollspy" aria-controls="js-navbar-scrollspy" aria-expanded="false" aria-label="Toggle navigation">
	                <span class="icon-bar"></span>
	                <span class="icon-bar"></span>
	            </button>
	        </div>
	
	        <div class="collapse navbar-collapse yangse" id="js-navbar-scrollspy">
	            <ul class="nav navbar-nav">
					
	                <li><a href="index.php">全部车辆</a></li>
	                <li><a href="tanjiayoux.html">添加车辆</a></li>
	                
	            </ul>
	        </div>
	    </div>
	</nav>
	
	
	
		<h1 style="text-align: center; "><?php echo $_GET['name']?></h1>
		<hr>
		<div id="juz">
			<div class="row">
			  <div class="col-md-6 " style="text-align: center;"><img src="img/<?php echo $p ?>" ></div>
			  <div class="col-md-6">
					<p>价格:<?php echo$w ?>元</p>
					<p>评分:<?php echo$e ?>/5</p>
					<p>级别:<?php echo$r ?>G</p>
					<p>品牌:<?php echo$t ?></p>
					<p>描述:<?php echo$y ?></p>
					<p>开卖时间:<?php echo$u ?></p>
				</div>
			</div>
			
			
			
				
				
				<div class="aj">
					<a href="xg.php?name=<?php echo $s ?>"><input type="button" class="btn btn-primary" name="" id="" value="修改信息" /></a>
					<input type="button" class="btn btn-danger" data-toggle="modal" data-target="#myModal" name="" id="" value="删除游戏" />
				</div>
		</div>
		
			
			
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title j" id="myModalLabel">
							删除车辆
						</h4>
					</div>
					<div class="modal-body j">
						<p>确定删这个车辆信息吗</p>
						<p>此操作不可恢复，请再次确定后点击删除按钮</p>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭
						</button>
						
						<a href="delete.php?name=<?php echo $s ?>">
						<button type="button" class="btn btn-primary">
							删除
						</button>
						</a>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
		</div>
		
	</div>
	

</body>
</html>
